package com.ghxxzx.dagl.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ghxxzx.dagl.entity.Role;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface RoleMapper extends BaseMapper<Role> {
    @Select("SELECT * FROM `role` ")
    List<Role> findAll();
    @Select("SELECT * FROM `role`  WHERE id!=1 ")
    List<Role> findNotRoot();

    @Select("SELECT * FROM role WHERE name=#{name}")
    Role findByName(@Param("name") String name);

    @Select("select * from role where id!=1")
    List<Role> selectListNotAdmin();
}
